﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.Text;

namespace OrganizerLibrary.ConfigFile
{
    public class OrganizerConfigSection : ConfigurationSection
    {
        public const String OrganizerConfigSectionName = "organizer";

        private const String DirectoryPathName = "directoryPath";
        [ConfigurationProperty(DirectoryPathName, DefaultValue = "", IsKey = false, IsRequired = true)]
        public String DirectoryPath
        {
            get { return (String) this[DirectoryPathName]; }
            set { this[DirectoryPathName] = value; }
        }

        private const String RouteNonMappedDirectoryName = "routeNonMappedDirectory";
        [ConfigurationProperty(RouteNonMappedDirectoryName, DefaultValue = "", IsKey = false, IsRequired = false)]
        public String RouteNonMappedDirectory
        {
            get { return (String) this[RouteNonMappedDirectoryName]; }
            set { this[RouteNonMappedDirectoryName] = value; }
        }

        private const String UseRelativePathsName = "useRelativePaths";
        [ConfigurationProperty(UseRelativePathsName, DefaultValue = false, IsKey = false, IsRequired = false)]
        public Boolean UseRelativePaths
        {
            get { return (Boolean)this[UseRelativePathsName]; }
            set { this[UseRelativePathsName] = value; }
        }

        private const String PollingPeriodInMillisecondsName = "pollingPeriodInMilliseconds";
        [ConfigurationProperty(PollingPeriodInMillisecondsName, DefaultValue = 10000, IsKey = false, IsRequired = false)]
        public Int32 PollingPeriodInMilliseconds
        {
            get { return (Int32)this[PollingPeriodInMillisecondsName]; }
            set { this[PollingPeriodInMillisecondsName] = value; }
        }

        private const String NumberOfRetriesName = "numberOfRetries";
        [ConfigurationProperty(NumberOfRetriesName, DefaultValue = 0, IsKey = false, IsRequired = false)]
        public Int32 NumberOfRetries
        {
            get { return (Int32)this[NumberOfRetriesName]; }
            set { this[NumberOfRetriesName] = value; }
        }

        private const String FileProcessorsName = "fileProcessors";
        [ConfigurationProperty(FileProcessorsName)]
        public FileProcessorConfigCollection FileProcessors
        {
            get { return (FileProcessorConfigCollection) base[FileProcessorsName]; }
        }

    }
}
